<template>
  <div id="app">
    <Header class="top" />
    <!-- <div class="top"></div> -->
    <router-view class="main"></router-view>
    <!-- <div class="main"></div> -->
    <!-- <div class="foot"></div> -->
    <Nav   v-if="!$route.path.includes('/topic') && !$route.path.includes('/register') && !$route.path.includes('/login')" @click="refrash" class="appNav foot" @setindex="fn" v-show="ifshow"></Nav>

    <!-- asdasdas -->
  </div>
</template>


<script>
import Nav from "./Nav.vue";
import Header from "./Header.vue";

export default {
  data() {
    return {
      //导航栏下标
      val: "",
      ifshow: true,
    };
  },
  components: {
    Nav,
    Header,
  },
  methods: {
    fn(val) {
      this.val = val;
      console.log(this.val, "val");
    },
    refrash() {
      fn(val);
    },
  },
  watch: {
    $route(to) {
      if (to.path == "/address" && "/newAddress") {
        this.ifshow = false;
      } else {
        this.ifshow = true;
      }
    },
  },
  mounted(){
    // document.body.addEventListener('touchmove', function (e) {
    //     e.preventDefault() // 阻止默认的处理方式(阻止下拉滑动的效果)
    // }, {passive: false}) // passive 参数不能省略，用来兼容ios和android
    
  }
};
</script>

<style scoped>

#app {
  height: 100vh;
  display: flex;
  /* background: red; */
  flex-direction: column;
}
.top{
  height: 8.1vh;
}
.main {
  flex: 1;
  overflow: auto;
  word-break: break-word;
  /* background: red; */
}
.foot{
  height: 6.6vh;
}
</style>
<style>
* {
  margin: 0;
  padding: 0;
  list-style: none;
  text-decoration: none;
}
</style>
